package com.wms.assets;

import java.util.HashMap;
import java.util.Map;

/**
 * Stores search criteria in an ArrayList<String>. If a particular criteria exists, the condition is updated in the item
 * @author Sukirat
 *
 */
public class SearchCriteria {

	private Map<String, String> criteria;
	//private Item searchItem;
	 
	/**
	 * Constructor creates a default item and initializes criteria Map
	 */
	public SearchCriteria() {
		//searchItem = new Item("",false,false,false,false,false,false);
		criteria = new HashMap<String, String>();
	}
	
	/**
	 * Returns the criterias that exist where field that correspond directly to 
	 * database field names, and type corresponds to the type of relation, eg. "LIKE username" or "> date" or "= false"
	 * @return Map<String field, String type> - field,type
	 */
	public Map<String, String> getCriterias(){
		return this.criteria;
		
	}
	
	/**
	 * Adds a criteria for filter
	 * @param field - one of the DatabaseKey
	 * @param type - corresponds to the type of relation in SQL, eg. "LIKE username" or "> date" or "= false"
	 */
	public void addCriteria(String field, String type){
		criteria.put(field, type);
	}
	
	
	
	
}
